<include file="/public/header" />

<style>
    .layui-card-body {
        padding-left: 0;
    }

    .layui-form-item .layui-input-inline {
        width: 220px;
    }
</style>

<div class="layui-fluid layui-bg-white">
    <form class="layui-form layui-form-fixed">
        <gt name="$data.id" value="0"><input type="text" name="id" value="{$data.id}" hidden=""></gt>
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('产品名称')}</label>
            <div class="layui-input-block">
                <input name="title" value="{$data.title}" placeholder="{:__('请输入产品名称')}" type="text" class="layui-input"
                    lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">产品图片</label>
            <div class="layui-input-block">
                <div class="layui-imagesbox">
                    <notempty name="$data['album']">
                        <volist name="$data['album']" id="vo">
                            <div class="layui-input-inline layui-uplpad-image">
                                <img src="{$vo.src}" lay-image-hover>
                                <input type="text" name="album[{$key}][src]" hidden value="{$vo.src}">
                                <input type="text" name="album[{$key}][title]" class="layui-input" value="{$vo.title}"
                                    placeholder="图片简介">
                                <span class="layui-badge layui-badge-red"
                                    onclick="layui.$(this).parent().remove();">删除</span>
                            </div>
                        </volist>
                    </notempty>
                    <div class="layui-input-inline layui-uplpad-image">
                        <div class="layui-upload-drag" lay-upload="album" data-type="multiple" data-accept="images"
                            data-size="102400">
                            <i class="layui-icon layui-icon-upload"></i>
                            <p>点击上传，或将文件拖拽到此处</p>
                            <div class="layui-hide"></div>
                        </div>
                        <input class="layui-upload-file" type="file" accept="" name="file">
                        <button type="button" class="layui-btn layui-btn-xs layui-btn-fluid" lay-choose="album"
                            data-type="multiple">
                            <i class="layui-icon layui-icon-windows"></i> 选择
                        </button>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('产品价')}</label>
            <div class="layui-input-block">
                <input name="price" value="{$data.price}" placeholder="{:__('请输入产品价')}" type="number"
                    class="layui-input" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('兑换积分')}</label>
            <div class="layui-input-block">
                <input name="integral" value="{$data.integral}" placeholder="{:__('请输入兑换积分')}" type="number"
                    class="layui-input" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('已兑换数量')}</label>
            <div class="layui-input-block">
                <input name="redeemed" value="{$data.redeemed}" placeholder="{:__('请输入已兑换数量')}" type="number"
                    class="layui-input" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('兑换类型')}</label>
            <div class="layui-input-block">
                <input name="type" type="radio" value="1" title="{:__('快递发货')}" <if $data.type== 1>checked</if> />
                <input name="type" type="radio" value="2" title="{:__('门店兑换')}" <if $data.type== 2>checked</if> />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('是否推荐')}</label>
            <div class="layui-input-block">
                <input name="ishot" type="radio" value="2" title="{:__('是')}" <if $data.ishot== 2>checked</if> />
                <input name="ishot" type="radio" value="1" title="{:__('否')}" <if $data.ishot== 1>checked</if> />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('上架状态')}</label>
            <div class="layui-input-block">
                <input name="status" type="radio" value="2" title="{:__('上架')}" <if $data.status== 2>checked</if> />
                <input name="status" type="radio" value="1" title="{:__('下架')}" <if $data.status== 1>checked</if> />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{:__('图文描述')}</label>
            <div class="layui-input-block">
                <textarea lay-editor id="detail" name="detail" type="layui-textarea">{$data.detail}</textarea>
            </div>
        </div>
        <div class="layui-footer layui-form-item layui-center ">
            <button class="layui-btn layui-btn-primary" type="button" sa-event="closeDialog">取消</button>
            <button class="layui-btn layui-btn-normal" lay-filter="submitIframe" type="button" lay-submit>提交</button>
        </div>
    </form>
</div>
<include file="/public/footer" />
<include file="/public/static" />